Skip to content

fix(find): give read-only find no-matches the same hint, and test the gesture viewport message - #5033

Merged
thymikee merged 4 commits into
callstack:mainfrom
imranbarbhuiya:fix/find-gesture-followups
Nov 23, 2026
Merged

thymikee merged 4 commits into
callstack:mainfrom
imranbarbhuiya:fix/find-gesture-followups

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5018.

  • A read-only find that matched nothing (exists, get text, get attrs) now carries the same recovery hint as the acting find. It already reported dispatched: no, and exists still fails on no match as before. The message and hint live in @agent-device/selectors, so both routes share them.
  • commands.md: the "Retry after a failed command" list of dispatched: no refusals now includes the find no-match. The gesture line now says that a pinch, rotate, transform, or two-finger pan that cannot keep its fingers far enough apart names only the viewport, which is what the minimum-span refusal does. The GESTURE_TRAJECTORY_OUT_OF_BOUNDS description in error-reasons.md covers that case too.
  • Tests: the out-of-bounds message names the viewport size, its origin when the viewport is offset, and the first point outside it (rounded, with the exact point in details.sample). The minimum-span refusal names no point and has no units hint. The find contract test checks the no-match hints for find label X focus, bare find X, and the read-only find label X exists.

Before / after

Android provider scenario, read-only find with no match (error.data):

find label Nowhere exists | get text | get attrs
base aecafaf30: hint "Read the diagnostics log for the failing step."   details {"dispatched":"no"}
head b6a0e7eb4: hint "Run snapshot -i to see current elements and refs, or scroll first if the element may be off-screen."   details {"dispatched":"no"}

Validation

  • Head b6a0e7eb4, check:affected --run --head, exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related pass.
  • The gesture, Android find and find contract tests pass.
  • check:doc-prose and check:command-docs pass.
  • 13 mutants (hint dropped or swapped, message changed on one route, viewport origin, rounding, point message, units hint, details fields) each fail a new assertion.

@thymikee

Copy link
Copy Markdown
Member

Thanks for closing the read-only find gap. The change at b09017e is ready: read-only find no-matches now carry the same hint as the acting route, and the gesture viewport message is tested. No conflicts. The two cancelled "Body rules" runs look unrelated, because that job checks PR body structure, the diff does not touch it, and the cancellation fits a PR body edit that starts a new run; the other 16 checks pass, including the Android provider and contract suites that exercise this route. Not blocking, and fine to take or leave: the message 'find did not match any element' is still written at both throw sites (selector-read.ts:123 and find-match-resolution.ts:86), so a shared FIND_NO_MATCH_MESSAGE next to FIND_NO_MATCH_HINT would prevent drift, and the read-only hint is asserted only in the Android scenario, so a read-only args row in the contract test would cover the daemon route too. Not verified here: any local test run, the 11-mutant claim (no artifact is available), and the full call chain that sets dispatched: no for the read route. Before merge, the "Body rules" check needs a rerun on the unchanged head.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
…d-only routes, and check the read-only hint on the daemon route
@imranbarbhuiya

Copy link
Copy Markdown
Contributor Author
  • Done in b6a0e7e: FIND_NO_MATCH_MESSAGE sits next to FIND_NO_MATCH_HINT in @agent-device/selectors, and both throw sites use it.
  • Done in b6a0e7e: the find contract test now has a read-only find label Nowhere exists row and checks its hint on the daemon route.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee

Copy link
Copy Markdown
Member

Thanks for the follow-up. The code at b6a0e7e looks good: the earlier review found nothing blocking, and this update adds nothing that changes that. All 15 checks pass at this head, including the Android provider and find contract suites that exercise both changed throw sites, and no conflicts are known. Nothing blocks merge. Not verified here: local test runs, the 13-mutant claim in the PR body (no artifact is attached), and an end-to-end trace of the daemon wrapper that sets dispatched:'no' for the read route. This update does not touch that wrapper, and the contract and Android tests assert the behavior at head.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee
thymikee merged commit f93099e into callstack:main Nov 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants